package com.edushare.common.constants;

import org.apache.wicket.RequestCycle;

import com.edushare.common.vo.Courses;
import com.edushare.common.vo.Departments;
import com.edushare.common.vo.Groups;
import com.edushare.common.vo.Universities;
import com.edushare.common.vo.Users;
import com.edushare.common.vo.interfaces.IFileUploadable;

public class DefaultFiles {
	
	public static final String DEFAULT_IMG_URL_USERS = "images/default/user_avtar.jpg";
	public static final String DEFAULT_IMG_URL_COURSES = "images/default/course_avtar.jpg";
	public static final String DEFAULT_IMG_URL_DEPARTMENTS = "images/default/dept_avtar.jpg";
	public static final String DEFAULT_IMG_URL_UNIVERSITY = "images/default/univ_avtar.jpg";
	public static final String DEFAULT_IMG_URL_NOIMAGE = "images/default/course_avtar.jpg";
	private static final String DEFAULT_IMG_URL_GROUP = "images/default/group_avtar.jpg";
	
	public static final String getDefaultImageFileUrl(IFileUploadable entity){
		String relUrl = "";
		if(entity instanceof Users){
			relUrl = DEFAULT_IMG_URL_USERS;
		} else if(entity instanceof Courses){
			relUrl = DEFAULT_IMG_URL_COURSES;
		} else if(entity instanceof Departments){
			relUrl = DEFAULT_IMG_URL_DEPARTMENTS;
		} else if(entity instanceof Universities){
			relUrl = DEFAULT_IMG_URL_UNIVERSITY;
		}else if(entity instanceof Groups){
			relUrl = DEFAULT_IMG_URL_GROUP;
		} else{
			relUrl = DEFAULT_IMG_URL_NOIMAGE;
		}
		
		return RequestCycle.get().getRequest().getRelativePathPrefixToContextRoot()+relUrl;
	}

}
